import { RouteRecordRaw } from "vue-router";
import UserLoginView from "@/views/user/UserLoginView.vue";
import GetUserView from "@/views/user/UserView.vue";
import InstitutionView from "@/views/institution/InstitutionView.vue";
import JobView from "@/views/institution/JobView.vue";
import RoleView from "@/views/institution/RoleView.vue";
import UserView from "@/views/institution/UserView.vue";
import HomeView from "@/components/HomeView.vue";
import AreaView from "@/views/system/AreaView.vue";
import MenuView from "@/views/system/MenuView.vue";
import SystemView from "@/views/system/SystemView.vue";
import StationView from "@/views/one/StationView.vue";
import DistributeView from "@/views/one/DistributeView.vue";
import Production1View from "@/views/production/Production1View.vue";
import Production2View from "@/views/production/Production2View.vue";
import Production3View from "@/views/production/Production3View.vue";
import RecorderView from "@/views/production/RecorderView.vue";
import Market1View from "@/views/sell/Market1View.vue";
import Market2View from "@/views/sell/Market2View.vue";
import TrendView from "@/views/sell/TrendView.vue";
import MonitorView from "@/views/monitor/MonitorView.vue";

export const routes: Array<RouteRecordRaw> = [
  {
    path: "/user",
    name: "用户",
    children: [
      {
        path: "/user/login",
        name: "用户",
        component: UserLoginView,
      },
    ],
  },

  {
    path: "/get/user",
    name: "登录用户",
    component: GetUserView,
  },

  {
    path: "/home",
    name: "主页",
    component: HomeView,
  },

  {
    path: "/institution",
    name: "组织机构",
    children: [
      {
        path: "/institution/institution",
        name: "机构管理",
        component: InstitutionView,
      },
      {
        path: "/institution/role",
        name: "角色管理",
        component: RoleView,
      },
      {
        path: "/institution/user",
        name: "用户管理",
        component: UserView,
      },
      {
        path: "/institution/job",
        name: "岗位管理",
        component: JobView,
      },
    ],
    meta: {
      hideInMenu: true,
    },
  },

  {
    path: "/system",
    name: "系统管理",
    children: [
      {
        path: "/system/menu",
        name: "菜单管理",
        component: MenuView,
      },
      {
        path: "/system/area",
        name: "区域管理",
        component: AreaView,
      },
      {
        path: "/system/system",
        name: "系统配置",
        component: SystemView,
      },
    ],
    meta: {
      hideInMenu: true,
    },
  },

  {
    path: "/one",
    name: "一张图",
    children: [
      {
        path: "/one/station",
        name: "基地风采",
        component: StationView,
      },
      {
        path: "/one/distribute",
        name: "产区分布",
        component: DistributeView,
      },
    ],
    meta: {
      hideInMenu: true,
    },
  },

  {
    path: "/production",
    name: "生产情况",
    children: [
      {
        path: "/production/production1",
        name: "种植规模",
        component: Production1View,
      },
      {
        path: "/production/production2",
        name: "预估产量产值",
        component: Production2View,
      },
      {
        path: "/production/production3",
        name: "上市周期",
        component: Production3View,
      },
      {
        path: "/production/recorder",
        name: "录像机",
        component: RecorderView,
      },
    ],
    meta: {
      hideInMenu: true,
    },
  },

  {
    path: "/sell",
    name: "营销情况",
    children: [
      {
        path: "/sell/market1",
        name: "销售记录",
        component: Market1View,
      },
      {
        path: "/sell/market2",
        name: "目标客户",
        component: Market2View,
      },
      {
        path: "/sell/trend",
        name: "市场行情",
        component: TrendView,
      },
    ],
    meta: {
      hideInMenu: true,
    },
  },

  {
    path: "/monitor",
    name: "监控记录",
    children: [
      {
        path: "/monitor/monitor",
        name: "用标主体",
        component: MonitorView,
      },
    ],
    meta: {
      hideInMenu: true,
    },
  },

  {
    path: "/",
    name: "默认",
    redirect: "/home",
  },
];
